home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / COSH.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  408 b   |  22 lines

  1. /* cosh.c FUNCTION, FROM P. 207 OF TURBO C BIBLE */
  2. #include<stdio.h>
  3. #include<math.h>
  4. #include<stdlib.h>            /* errno defined here */
  5. main(int argc, char **argv)
  6. {
  7.     double result;
  8.  
  9.     if(argc < 2)
  10.     {
  11.         printf("Usage %s <value>\n", argv[0]);
  12.     }
  13.     else
  14.     {
  15.         result = cosh(atof(argv[1]));
  16.         if( errno != ERANGE)
  17.         {
  18.             printf("Hyperbolic cosine of %s = %f\n",
  19.                             argv[1], result);
  20.         }
  21.     }
  22. }